package com.yhsoft.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author yyyyyyyh
 * @since 2023-08-30
 */
@TableName("x_user")
@Data
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    private String username;
    private String password;
    private String name;
    private String email;
    private String phone;
    private Integer status;
    private String avatar;
    private Integer deleted;
    private Integer companyId;
    /**
     * 平台-sys 供货商-vender 渠道商-saler
     */
    private String sysType;
    /**
     * 超级管理员-0
     * 管理员-	1
     * 运营	-	2
     * 客服	-	3
     * 财务	-	4
     * 人事	-	5
     */
    private String role;
    private Integer isAdmin;
    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime updatedTime;

    // 暂时废弃
//    @TableField(exist = false)
//    private List<Integer> roleIdList;
}
